/**
 * Copyright (C) 2012 The SkyTvOS Project
 * <p/>
 * Version     Date           Author
 * ─────────────────────────────────────
 * 2012-10-23         luwei
 */

package com.coocaa.framework.ui;

import android.view.View;

import java.util.List;

public abstract class BaseAdapter<T> {
    public interface ObserverListener {
        public void onChanaged();
    }

    protected ObserverListener mObserver = null;

    public abstract int getCount();

    public abstract int getPosition();

    public abstract void refreshUI(List<T> datas);

    public abstract View getView(int position, View convertView, boolean[] turnpage);

    public abstract void destory();

    public void notifyDataSetChanaged() {
        if (mObserver != null) {
            mObserver.onChanaged();
        }
    }

    public void registObserver(ObserverListener listener) {
        mObserver = listener;
    }
}
